package com.macro.mall.remton;

import com.macro.mall.common.api.CommonResult;
import com.macro.mall.common.dto.EsIndexDto;
import com.macro.mall.common.dto.EsTableDto;
import com.macro.mall.model.PmsProutr;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient("mall-es")
public interface EsServiceRemton {
    @PostMapping("/index/creatProductIndex")
    public CommonResult createProductIndex(@Validated @RequestBody EsIndexDto esIndexDto);
    @PostMapping("/index/searchIndexChecker/{indexName}")
    public CommonResult searchIndexChecker(@PathVariable String indexName);
    @PostMapping("/table/doAddAll")
     CommonResult doAddAll(@RequestBody List<PmsProutr> responseList);
    @PostMapping("/table/delAll/{indexName}")
    public void delAll(@PathVariable String indexName);
    @PostMapping("/table/delEs")
    public void delEs(@RequestBody EsTableDto esIndexDto);
}
